<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkExpander</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="LayoutContainers.html" title="布局容器">
<link rel="prev" href="gtk3-GtkTable.html" title="GtkTable">
<link rel="next" href="gtk3-Orientable.html" title="GtkOrientable">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkTable.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="LayoutContainers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-Orientable.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkExpander.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkExpander.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkExpander"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkExpander.top_of_page"></a>GtkExpander</span></h2>
<p>GtkExpander — A container which can hide its child</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkExpander.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander">GtkExpander</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkExpander.html#gtk-expander-new" title="gtk_expander_new ()">gtk_expander_new</a>                    (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkExpander.html#gtk-expander-new-with-mnemonic" title="gtk_expander_new_with_mnemonic ()">gtk_expander_new_with_mnemonic</a>      (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-expanded" title="gtk_expander_set_expanded ()">gtk_expander_set_expanded</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expanded</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-expanded" title="gtk_expander_get_expanded ()">gtk_expander_get_expanded</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-spacing" title="gtk_expander_set_spacing ()">gtk_expander_set_spacing</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> spacing</code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-spacing" title="gtk_expander_get_spacing ()">gtk_expander_get_spacing</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-label" title="gtk_expander_set_label ()">gtk_expander_set_label</a>              (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-label" title="gtk_expander_get_label ()">gtk_expander_get_label</a>              (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-use-underline" title="gtk_expander_set_use_underline ()">gtk_expander_set_use_underline</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_underline</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-use-underline" title="gtk_expander_get_use_underline ()">gtk_expander_get_use_underline</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-use-markup" title="gtk_expander_set_use_markup ()">gtk_expander_set_use_markup</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_markup</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-use-markup" title="gtk_expander_get_use_markup ()">gtk_expander_get_use_markup</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-label-widget" title="gtk_expander_set_label_widget ()">gtk_expander_set_label_widget</a>       (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *label_widget</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-label-widget" title="gtk_expander_get_label_widget ()">gtk_expander_get_label_widget</a>       (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-label-fill" title="gtk_expander_set_label_fill ()">gtk_expander_set_label_fill</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> label_fill</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkExpander.html#gtk-expander-get-label-fill" title="gtk_expander_get_label_fill ()">gtk_expander_get_label_fill</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkExpander.description"></a><h2>Description</h2>
<p>
A <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> allows the user to hide or show its child by clicking
on an expander triangle similar to the triangles used in a <a class="link" href="gtk3-GtkTreeView.html#GtkTreeView" title="struct GtkTreeView"><span class="type">GtkTreeView</span></a>.
</p>
<p>
Normally you use an expander as you would use any other descendant
of <a class="link" href="gtk3-GtkBin.html#GtkBin" title="struct GtkBin"><span class="type">GtkBin</span></a>; you create the child widget and use <a class="link" href="gtk3-GtkContainer.html#gtk-container-add" title="gtk_container_add ()"><code class="function">gtk_container_add()</code></a>
to add it to the expander. When the expander is toggled, it will take
care of showing and hiding the child automatically.
</p>
<p>
</p>
<div class="refsect2">
<a name="expander-special-usage"></a><h3>Special Usage</h3>
<p>
There are situations in which you may prefer to show and hide the
expanded widget yourself, such as when you want to actually create
the widget at expansion time. In this case, create a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
but do not add a child to it. The expander widget has an
<span class="type">"expanded"</span> property which can be used to monitor
its expansion state. You should watch this property with a signal
connection as follows:
</p>
<div class="informalexample">
<a name="expander-callback-example"></a><pre class="programlisting">
expander = gtk_expander_new_with_mnemonic ("_More Options");
g_signal_connect (expander, "notify::expanded",
                  G_CALLBACK (expander_callback), NULL);

...

static void
expander_callback (GObject    *object,
                   GParamSpec *param_spec,
                   gpointer    user_data)
{
  GtkExpander *expander;

  expander = GTK_EXPANDER (object);

  if (gtk_expander_get_expanded (expander))
    {
      /* Show or create widgets */
    }
  else
    {
      /* Hide or destroy widgets */
    }
}
</pre>
</div>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="GtkExpander-BUILDER-UI"></a><h3>GtkExpander as GtkBuildable</h3>
<p>
The GtkExpander implementation of the GtkBuildable interface
supports placing a child in the label position by specifying
"label" as the "type" attribute of a &lt;child&gt; element.
A normal content child can be specified without specifying
a &lt;child&gt; type attribute.
</p>
<div class="example">
<a name="id3703801"></a><p class="title"><b>Example 78. A UI definition fragment with GtkExpander</b></p>
<div class="example-contents"><pre class="programlisting">
&lt;object class="GtkExpander"&gt;
  &lt;child type="label"&gt;
    &lt;object class="GtkLabel" id="expander-label"/&gt;
  &lt;/child&gt;
  &lt;child&gt;
    &lt;object class="GtkEntry" id="expander-content"/&gt;
  &lt;/child&gt;
&lt;/object&gt;
</pre></div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkExpander.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkExpander"></a><h3>struct GtkExpander</h3>
<pre class="programlisting">struct GtkExpander {
  GtkBin              bin;

  GtkExpanderPrivate *priv;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-new"></a><h3>gtk_expander_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_expander_new                    (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new expander using <em class="parameter"><code>label</code></em> as the text of the label.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text of the label</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> widget.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-new-with-mnemonic"></a><h3>gtk_expander_new_with_mnemonic ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_expander_new_with_mnemonic      (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new expander using <em class="parameter"><code>label</code></em> as the text of the label.
If characters in <em class="parameter"><code>label</code></em> are preceded by an underscore, they are underlined.
If you need a literal underscore character in a label, use '__' (two
underscores). The first underlined character represents a keyboard
accelerator called a mnemonic.
Pressing Alt and that key activates the button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text of the label with an underscore
in front of the mnemonic character. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> widget.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-expanded"></a><h3>gtk_expander_set_expanded ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_expanded           (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expanded</code></em>);</pre>
<p>
Sets the state of the expander. Set to <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, if you want
the child widget to be revealed, and <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if you want the
child widget to be hidden.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>expanded</code></em> :</span></p></td>
<td>whether the child widget is revealed</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-expanded"></a><h3>gtk_expander_get_expanded ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_expander_get_expanded           (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Queries a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> and returns its current state. Returns <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
if the child widget is revealed.
</p>
<p>
See <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-expanded" title="gtk_expander_set_expanded ()"><code class="function">gtk_expander_set_expanded()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current state of the expander</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-spacing"></a><h3>gtk_expander_set_spacing ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_spacing            (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> spacing</code></em>);</pre>
<p>
Sets the spacing field of <em class="parameter"><code>expander</code></em>, which is the number of
pixels to place between expander and the child.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>spacing</code></em> :</span></p></td>
<td>distance between the expander and child in pixels</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-spacing"></a><h3>gtk_expander_get_spacing ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gtk_expander_get_spacing            (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Gets the value set by <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-spacing" title="gtk_expander_set_spacing ()"><code class="function">gtk_expander_set_spacing()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>spacing between the expander and child</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-label"></a><h3>gtk_expander_set_label ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_label              (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Sets the text of the label of the expander to <em class="parameter"><code>label</code></em>.
</p>
<p>
This will also clear any previously set labels.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>a string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-label"></a><h3>gtk_expander_get_label ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_expander_get_label              (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Fetches the text from a label widget including any embedded
underlines indicating mnemonics and Pango markup, as set by
<a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-label" title="gtk_expander_set_label ()"><code class="function">gtk_expander_set_label()</code></a>. If the label text has not been set the
return value will be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. This will be the case if you create an
empty button with <a class="link" href="gtk3-GtkButton.html#gtk-button-new" title="gtk_button_new ()"><code class="function">gtk_button_new()</code></a> to use as a container.
</p>
<p>
Note that this function behaved differently in versions prior to
2.14 and used to return the label text stripped of embedded
underlines indicating mnemonics and Pango markup. This problem can
be avoided by fetching the label text directly from the label
widget.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The text of the label widget. This string is owned
by the widget and must not be modified or freed.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-use-underline"></a><h3>gtk_expander_set_use_underline ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_use_underline      (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_underline</code></em>);</pre>
<p>
If true, an underline in the text of the expander label indicates
the next character should be used for the mnemonic accelerator key.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>use_underline</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if underlines in the text indicate mnemonics</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-use-underline"></a><h3>gtk_expander_get_use_underline ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_expander_get_use_underline      (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Returns whether an embedded underline in the expander label
indicates a mnemonic. See <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-use-underline" title="gtk_expander_set_use_underline ()"><code class="function">gtk_expander_set_use_underline()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if an embedded underline in the expander
label indicates the mnemonic accelerator keys</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-use-markup"></a><h3>gtk_expander_set_use_markup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_use_markup         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_markup</code></em>);</pre>
<p>
Sets whether the text of the label contains markup in <GTKDOCLINK HREF="PangoMarkupFormat">Pango's text markup
language</GTKDOCLINK>. See <a class="link" href="gtk3-GtkLabel.html#gtk-label-set-markup" title="gtk_label_set_markup ()"><code class="function">gtk_label_set_markup()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>use_markup</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the label's text should be parsed for markup</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-use-markup"></a><h3>gtk_expander_get_use_markup ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_expander_get_use_markup         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Returns whether the label's text is interpreted as marked up with
the <GTKDOCLINK HREF="PangoMarkupFormat">Pango text markup
language</GTKDOCLINK>. See <a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-use-markup" title="gtk_expander_set_use_markup ()"><code class="function">gtk_expander_set_use_markup()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the label's text will be parsed for markup</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-label-widget"></a><h3>gtk_expander_set_label_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_label_widget       (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *label_widget</code></em>);</pre>
<p>
Set the label widget for the expander. This is the widget
that will appear embedded alongside the expander arrow.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label_widget</code></em> :</span></p></td>
<td>the new label widget. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-label-widget"></a><h3>gtk_expander_get_label_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_expander_get_label_widget       (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Retrieves the label widget for the frame. See
<a class="link" href="gtk3-GtkExpander.html#gtk-expander-set-label-widget" title="gtk_expander_set_label_widget ()"><code class="function">gtk_expander_set_label_widget()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the label widget,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is none. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-set-label-fill"></a><h3>gtk_expander_set_label_fill ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_expander_set_label_fill         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> label_fill</code></em>);</pre>
<p>
Sets whether the label widget should fill all available
horizontal space allocated to <em class="parameter"><code>expander</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label_fill</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the label should should fill
all available horizontal space</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-expander-get-label-fill"></a><h3>gtk_expander_get_label_fill ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_expander_get_label_fill         (<em class="parameter"><code><a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a> *expander</code></em>);</pre>
<p>
Returns whether the label widget will fill all available
horizontal space allocated to <em class="parameter"><code>expander</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expander</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkExpander.html#GtkExpander" title="struct GtkExpander"><span class="type">GtkExpander</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the label widget will fill all
available horizontal space</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>